package com.cmsky.open.shop.model;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import com.cmsky.open.base.model.AreaInfo;
import com.cmsky.open.base.model.GoodsClassifyInfo;
import com.cmsky.open.core.base.*;
import com.cmsky.open.core.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.cmsky.open.shop.model.*;
import com.cmsky.open.shop.dao.*;
import com.cmsky.open.shop.manager.*;
import com.cmsky.open.shop.vo.query.*;

/**
 * @author jandyfish email:jandyfish(a)gmail.com
 * @version 1.0
 * @since 1.0
 */


public class ShopAreaInfo extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "ShopAreaInfo";
	public static final String ALIAS_ID = "编号";
	public static final String ALIAS_AREA_ID = "社区";
	public static final String ALIAS_SHOP_ID = "商户";
	public static final String ALIAS_GOODS_CLASSIFY_ID = "商品类型";
	public static final String ALIAS_NUM = "数量上限";
	
	//date formats
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 编号       db_column: id 
     */	
	
	private java.lang.Integer id;
    /**
     * 社区       db_column: area_id 
     */	
	@NotNull 
	private java.lang.Integer areaId;
    /**
     * 商户       db_column: shop_id 
     */	
	@NotNull 
	private java.lang.Integer shopId;
    /**
     * 商品类型       db_column: goods_classify_id 
     */	
	@NotNull 
	private java.lang.Integer goodsClassifyId;
    /**
     * 数量上限       db_column: num 
     */	
	@NotNull 
	private java.lang.Integer num;
	//columns END

	public ShopAreaInfo(){
	}

	public ShopAreaInfo(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setAreaId(java.lang.Integer value) {
		this.areaId = value;
	}
	
	public java.lang.Integer getAreaId() {
		return this.areaId;
	}
	public void setShopId(java.lang.Integer value) {
		this.shopId = value;
	}
	
	public java.lang.Integer getShopId() {
		return this.shopId;
	}
	public void setGoodsClassifyId(java.lang.Integer value) {
		this.goodsClassifyId = value;
	}
	
	public java.lang.Integer getGoodsClassifyId() {
		return this.goodsClassifyId;
	}
	public void setNum(java.lang.Integer value) {
		this.num = value;
	}
	
	public java.lang.Integer getNum() {
		return this.num;
	}
	
	private GoodsClassifyInfo goodsClassifyInfo;
	
	public void setGoodsClassifyInfo(GoodsClassifyInfo goodsClassifyInfo){
		this.goodsClassifyInfo = goodsClassifyInfo;
	}
	
	public GoodsClassifyInfo getGoodsClassifyInfo() {
		return goodsClassifyInfo;
	}
	
	private AreaInfo areaInfo;
	
	public void setAreaInfo(AreaInfo areaInfo){
		this.areaInfo = areaInfo;
	}
	
	public AreaInfo getAreaInfo() {
		return areaInfo;
	}
	
	private ShopInfo shopInfo;
	
	public void setShopInfo(ShopInfo shopInfo){
		this.shopInfo = shopInfo;
	}
	
	public ShopInfo getShopInfo() {
		return shopInfo;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("AreaId",getAreaId())
			.append("ShopId",getShopId())
			.append("GoodsClassifyId",getGoodsClassifyId())
			.append("Num",getNum())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof ShopAreaInfo == false) return false;
		if(this == obj) return true;
		ShopAreaInfo other = (ShopAreaInfo)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.append(getAreaId(),other.getAreaId())
			.append(getShopId(),other.getShopId())
			.append(getGoodsClassifyId(),other.getGoodsClassifyId())
			.append(getNum(),other.getNum())
			.isEquals();
	}
}

